﻿namespace ProjectIndieFarm
{
    public class ChallengeGroupPumpkin
    {
        public static void Setup(IChallengeSystem system)
        {
            var carrot1 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第 1个南瓜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountPumpkin > 0)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 300;
                    self.SendMessageWithReward(300);
                }));
            var carrot10 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第10个南瓜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountPumpkin >= 10)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 300;
                    self.SendMessageWithReward(300);
                }));
            var carrot20 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第20个南瓜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountPumpkin >= 20)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 300;
                    self.SendMessageWithReward(300);
                }));
            var carrot30 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第30个南瓜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountPumpkin >= 30)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 300;
                    Global.ShowPumpkinSeedInShop.Value = true;
                    self.SendMessageWithReward(300);
                }));
        }
    }
}
